import axios from '../axios'

/*
 * 角色管理模块
 */

// 保存
export const save = (data) => {
    return axios({
        url: '/systemUserRole/saveRole',
        method: 'post',
        data
    })
}
//  编辑
export const roleedit = (data) => {
    return axios({
        url: '/systemUserRole/updateRole',
        method: 'post',
        data
    })
}
// 分页查询
export const findPage = (params) => {
    return axios({
        url: '/systemUserRole/queryRoleList',
        method: 'get',
        params
    })
}
// 查询全部
export const findAll = () => {
    return axios({
        url: '/role/findAll',
        method: 'get'
    })
}
// 查询角色菜单集合
export const findRoleMenus = (params) => {
    return axios({
        url: '/systemUserRole/queryRoleById',
        method: 'get',
        params
    })
}
// 保存角色菜单集合
export const saveRoleMenus = (data) => {
    return axios({
        url: '/role/saveRoleMenus',
        method: 'post',
        data
    })
}
// 获取角色信息
export const queryUserRole = (params) => {
    return axios({
        url: '/systemUser/queryUserRole',
        method: 'get',
        params
    })
}

// ################前台角色相关接口##############
// 前台添加角色
export const saveFontRole = (data) => {
    return axios({
        url: '/frontUserRole/saveRole',
        method: 'post',
        data
    })
}
// 查询前台角色列表
export const queryFontRoleList = (params) => {
    return axios({
        url: '/frontUserRole/queryRoleList',
        method: 'get',
        params
    })
}
// 编辑角色
export const updateFontRole = (data) => {
    return axios({
        url: '/frontUserRole/updateRole',
        method: 'post',
        data
    })
}
